home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / obero / oberon_lib.lha / oberon-a / source1.lha / source / Amiga / MathResource.mod < prev    next >
Text File  |  1994-08-08  |  3KB  |  108 lines

  1. (**************************************************************************
  2.  
  3.      $RCSfile: MathResource.mod $
  4.   Description: Interface to MathIEEE.resource
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.2 $
  8.       $Author: fjc $
  9.         $Date: 1994/08/08 00:45:36 $
  10.  
  11.   $VER: mathresource.h 1.2 (13.7.90)
  12.   Includes Release 40.15
  13.  
  14.   (C) Copyright 1985-1993 Commodore-Amiga, Inc.
  15.       All Rights Reserved
  16.  
  17.   Oberon-A interface Copyright © 1994, Frank Copeland.
  18.   This file is part of the Oberon-A Interface.
  19.   See Oberon-A.doc for conditions of use and distribution.
  20.  
  21. ***************************************************************************)
  22.  
  23. MODULE MathResource;
  24.  
  25. (*
  26. ** $C- CaseChk       $I- IndexChk  $L+ LongAdr   $N- NilChk
  27. ** $P- PortableCode  $R- RangeChk  $S- StackChk  $T- TypeChk
  28. ** $V- OvflChk       $Z- ZeroVars
  29. *)
  30.  
  31. IMPORT E := Exec;
  32.  
  33.  
  34. (*
  35. **
  36. **      Data structure returned by OpenResource of:
  37. **      "MathIEEE.resource"
  38. **
  39. *)
  40.  
  41.  
  42. (*
  43. *       The 'Init' entries are only used if the corresponding
  44. *       bit is set in the Flags field.
  45. *
  46. *       So if you are just a 68881, you do not need the Init stuff
  47. *       just make sure you have cleared the Flags field.
  48. *
  49. *       This should allow us to add Extended Precision later.
  50. *
  51. *       For Init users, if you need to be called whenever a task
  52. *       opens this library for use, you need to change the appropriate
  53. *       entries in MathIEEELibrary.
  54. *)
  55.  
  56. TYPE
  57.  
  58.   MathIEEEResourcePtr * = CPOINTER TO MathIEEEResource;
  59.   MathIEEEResource * = RECORD (E.Node)
  60.     flags *        : E.WSET;
  61.     baseAddr *     : E.APTR; (* ptr to 881 if exists *)
  62.     dblBasInit *   : E.PROC;
  63.     dblTransInit * : E.PROC;
  64.     sglBasInit *   : E.PROC;
  65.     sglTransInit * : E.PROC;
  66.     extBasInit *   : E.PROC;
  67.     extTransInit * : E.PROC;
  68.   END; (* MathIEEEResource *)
  69.  
  70. CONST
  71.  
  72. (* definations for MathIEEEResourceFLAGS *)
  73.   dblBas        * = 0;
  74.   dblTrans      * = 1;
  75.   sglBas        * = 2;
  76.   sglTrans      * = 3;
  77.   extBas        * = 4;
  78.   extTrans      * = 5;
  79.  
  80.  
  81. (*-- Resource Base variable --------------------------------------------*)
  82.  
  83. CONST
  84.  
  85.   name * = "MathIEEE.resource";
  86.  
  87. VAR
  88.  
  89.   base * : MathIEEEResourcePtr;
  90.  
  91.  
  92. (*-- Resource Base variable --------------------------------------------*)
  93. (* $L- Address globals through A4 *)
  94.  
  95.  
  96. (*-----------------------------------*)
  97. PROCEDURE OpenResource * (mustOpen : BOOLEAN);
  98.  
  99. BEGIN (* OpenResource *)
  100.   IF base = NIL THEN
  101.     base := E.base.OpenResource (name);
  102.     IF mustOpen & (base = NIL) THEN HALT (100) END;
  103.   END
  104. END OpenResource;
  105.  
  106.  
  107. END MathResource.
  108.